3.439 \(\int \cot (c+d x) (a+b \tan (c+d x))^3 \, dx\)

Optimal. Leaf size=62 \[ b x \left (3 a^2-b^2\right )+\frac{a^3 \log (\sin (c+d x))}{d}+\frac{b^2 (a+b \tan (c+d x))}{d}-\frac{3 a b^2 \log (\cos (c+d x))}{d} \]

[Out]

b*(3*a^2 - b^2)*x - (3*a*b^2*Log[Cos[c + d*x]])/d + (a^3*Log[Sin[c + d*x]])/d + (b^2*(a + b*Tan[c + d*x]))/d

________________________________________________________________________________________

Rubi [A]  time = 0.0759293, antiderivative size = 62, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 3, integrand size = 19, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.158, Rules used = {3566, 3624, 3475} \[ b x \left (3 a^2-b^2\right )+\frac{a^3 \log (\sin (c+d x))}{d}+\frac{b^2 (a+b \tan (c+d x))}{d}-\frac{3 a b^2 \log (\cos (c+d x))}{d} \]

Antiderivative was successfully verified.

[In]

Int[Cot[c + d*x]*(a + b*Tan[c + d*x])^3,x]

[Out]

b*(3*a^2 - b^2)*x - (3*a*b^2*Log[Cos[c + d*x]])/d + (a^3*Log[Sin[c + d*x]])/d + (b^2*(a + b*Tan[c + d*x]))/d

Rule 3566

Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Si
mp[(b^2*(a + b*Tan[e + f*x])^(m - 2)*(c + d*Tan[e + f*x])^(n + 1))/(d*f*(m + n - 1)), x] + Dist[1/(d*(m + n -
1)), Int[(a + b*Tan[e + f*x])^(m - 3)*(c + d*Tan[e + f*x])^n*Simp[a^3*d*(m + n - 1) - b^2*(b*c*(m - 2) + a*d*(
1 + n)) + b*d*(m + n - 1)*(3*a^2 - b^2)*Tan[e + f*x] - b^2*(b*c*(m - 2) - a*d*(3*m + 2*n - 4))*Tan[e + f*x]^2,
 x], x], x] /; FreeQ[{a, b, c, d, e, f, n}, x] && NeQ[b*c - a*d, 0] && NeQ[a^2 + b^2, 0] && NeQ[c^2 + d^2, 0]
&& IntegerQ[2*m] && GtQ[m, 2] && (GeQ[n, -1] || IntegerQ[m]) &&  !(IGtQ[n, 2] && ( !IntegerQ[m] || (EqQ[c, 0]
&& NeQ[a, 0])))

Rule 3624

Int[((A_) + (B_.)*tan[(e_.) + (f_.)*(x_)] + (C_.)*tan[(e_.) + (f_.)*(x_)]^2)/tan[(e_.) + (f_.)*(x_)], x_Symbol
] :> Simp[B*x, x] + (Dist[A, Int[1/Tan[e + f*x], x], x] + Dist[C, Int[Tan[e + f*x], x], x]) /; FreeQ[{e, f, A,
 B, C}, x] && NeQ[A, C]

Rule 3475

Int[tan[(c_.) + (d_.)*(x_)], x_Symbol] :> -Simp[Log[RemoveContent[Cos[c + d*x], x]]/d, x] /; FreeQ[{c, d}, x]

Rubi steps

\begin{align*} \int \cot (c+d x) (a+b \tan (c+d x))^3 \, dx &=\frac{b^2 (a+b \tan (c+d x))}{d}+\int \cot (c+d x) \left (a^3+b \left (3 a^2-b^2\right ) \tan (c+d x)+3 a b^2 \tan ^2(c+d x)\right ) \, dx\\ &=b \left (3 a^2-b^2\right ) x+\frac{b^2 (a+b \tan (c+d x))}{d}+a^3 \int \cot (c+d x) \, dx+\left (3 a b^2\right ) \int \tan (c+d x) \, dx\\ &=b \left (3 a^2-b^2\right ) x-\frac{3 a b^2 \log (\cos (c+d x))}{d}+\frac{a^3 \log (\sin (c+d x))}{d}+\frac{b^2 (a+b \tan (c+d x))}{d}\\ \end{align*}

Mathematica [C]  time = 0.190676, size = 79, normalized size = 1.27 \[ -\frac{-2 a^3 \log (\tan (c+d x))-2 b^2 (a+b \tan (c+d x))+(a+i b)^3 \log (-\tan (c+d x)+i)+(a-i b)^3 \log (\tan (c+d x)+i)}{2 d} \]

Antiderivative was successfully verified.

[In]

Integrate[Cot[c + d*x]*(a + b*Tan[c + d*x])^3,x]

[Out]

-((a + I*b)^3*Log[I - Tan[c + d*x]] - 2*a^3*Log[Tan[c + d*x]] + (a - I*b)^3*Log[I + Tan[c + d*x]] - 2*b^2*(a +
 b*Tan[c + d*x]))/(2*d)

________________________________________________________________________________________

Maple [A]  time = 0.047, size = 77, normalized size = 1.2 \begin{align*} 3\,x{a}^{2}b-{b}^{3}x+{\frac{{b}^{3}\tan \left ( dx+c \right ) }{d}}+{\frac{{a}^{3}\ln \left ( \sin \left ( dx+c \right ) \right ) }{d}}-3\,{\frac{a{b}^{2}\ln \left ( \cos \left ( dx+c \right ) \right ) }{d}}+3\,{\frac{{a}^{2}bc}{d}}-{\frac{{b}^{3}c}{d}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cot(d*x+c)*(a+b*tan(d*x+c))^3,x)

[Out]

3*x*a^2*b-b^3*x+1/d*b^3*tan(d*x+c)+a^3*ln(sin(d*x+c))/d-3*a*b^2*ln(cos(d*x+c))/d+3/d*a^2*b*c-1/d*b^3*c

________________________________________________________________________________________

Maxima [A]  time = 1.60093, size = 96, normalized size = 1.55 \begin{align*} \frac{2 \, a^{3} \log \left (\tan \left (d x + c\right )\right ) + 2 \, b^{3} \tan \left (d x + c\right ) + 2 \,{\left (3 \, a^{2} b - b^{3}\right )}{\left (d x + c\right )} -{\left (a^{3} - 3 \, a b^{2}\right )} \log \left (\tan \left (d x + c\right )^{2} + 1\right )}{2 \, d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(d*x+c)*(a+b*tan(d*x+c))^3,x, algorithm="maxima")

[Out]

1/2*(2*a^3*log(tan(d*x + c)) + 2*b^3*tan(d*x + c) + 2*(3*a^2*b - b^3)*(d*x + c) - (a^3 - 3*a*b^2)*log(tan(d*x
+ c)^2 + 1))/d

________________________________________________________________________________________

Fricas [A]  time = 1.82292, size = 185, normalized size = 2.98 \begin{align*} \frac{a^{3} \log \left (\frac{\tan \left (d x + c\right )^{2}}{\tan \left (d x + c\right )^{2} + 1}\right ) - 3 \, a b^{2} \log \left (\frac{1}{\tan \left (d x + c\right )^{2} + 1}\right ) + 2 \, b^{3} \tan \left (d x + c\right ) + 2 \,{\left (3 \, a^{2} b - b^{3}\right )} d x}{2 \, d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(d*x+c)*(a+b*tan(d*x+c))^3,x, algorithm="fricas")

[Out]

1/2*(a^3*log(tan(d*x + c)^2/(tan(d*x + c)^2 + 1)) - 3*a*b^2*log(1/(tan(d*x + c)^2 + 1)) + 2*b^3*tan(d*x + c) +
 2*(3*a^2*b - b^3)*d*x)/d

________________________________________________________________________________________

Sympy [A]  time = 1.37284, size = 92, normalized size = 1.48 \begin{align*} \begin{cases} - \frac{a^{3} \log{\left (\tan ^{2}{\left (c + d x \right )} + 1 \right )}}{2 d} + \frac{a^{3} \log{\left (\tan{\left (c + d x \right )} \right )}}{d} + 3 a^{2} b x + \frac{3 a b^{2} \log{\left (\tan ^{2}{\left (c + d x \right )} + 1 \right )}}{2 d} - b^{3} x + \frac{b^{3} \tan{\left (c + d x \right )}}{d} & \text{for}\: d \neq 0 \\x \left (a + b \tan{\left (c \right )}\right )^{3} \cot{\left (c \right )} & \text{otherwise} \end{cases} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(d*x+c)*(a+b*tan(d*x+c))**3,x)

[Out]

Piecewise((-a**3*log(tan(c + d*x)**2 + 1)/(2*d) + a**3*log(tan(c + d*x))/d + 3*a**2*b*x + 3*a*b**2*log(tan(c +
 d*x)**2 + 1)/(2*d) - b**3*x + b**3*tan(c + d*x)/d, Ne(d, 0)), (x*(a + b*tan(c))**3*cot(c), True))

________________________________________________________________________________________

Giac [A]  time = 1.96545, size = 97, normalized size = 1.56 \begin{align*} \frac{2 \, a^{3} \log \left ({\left | \tan \left (d x + c\right ) \right |}\right ) + 2 \, b^{3} \tan \left (d x + c\right ) + 2 \,{\left (3 \, a^{2} b - b^{3}\right )}{\left (d x + c\right )} -{\left (a^{3} - 3 \, a b^{2}\right )} \log \left (\tan \left (d x + c\right )^{2} + 1\right )}{2 \, d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(d*x+c)*(a+b*tan(d*x+c))^3,x, algorithm="giac")

[Out]

1/2*(2*a^3*log(abs(tan(d*x + c))) + 2*b^3*tan(d*x + c) + 2*(3*a^2*b - b^3)*(d*x + c) - (a^3 - 3*a*b^2)*log(tan
(d*x + c)^2 + 1))/d